package socketmvc.core.packets.basic.impl;

import org.tio.websocket.common.util.BASE64Util;
import socketmvc.core.packets.basic.JsonBasicPacket;
import socketmvc.core.packets.basic.Protocol;

public class JsonBase64Packet extends JsonBasicPacket {

    public JsonBase64Packet(JsonTextBody textBody, String base64BinBody){
        this.textBody = textBody;
        this.binBody = BASE64Util.base64ToByteArray(base64BinBody);
    }

    @Override
    public byte protocolVersion() {
        return Protocol.JSON_TEXT_BASE64_CONTENT.getVersion();
    }

    @Override
    public String protocolName() {
        return Protocol.JSON_TEXT_BASE64_CONTENT.getName();
    }

}
